package com.gjty.healthmgr.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/")
public class IndexController {

    @GetMapping("")
    public String index() {
        return "index";
    }

    @GetMapping("loginPage")
    public String loginPage() {
        return "login";
    }

    @PostMapping("login")
    public String login() {
        return "redirect:/";
    }

    @GetMapping("logout")
    public String logout() {
        return "redirect:loginPage";
    }
}
